package cn.lg.soar.system.auth.entity;

import cn.lg.soar.database.base.entity.BaseEntity;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author luguoxiang
 * @date 2022/5/28
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
@ExcelIgnoreUnannotated
@Getter
@Setter
@Accessors(chain = true)
@ApiModel(value="应用", description="单点登录客户端")
@TableName("lg_sys_sso_apply")
public class SsoApply extends BaseEntity {


    private static final long serialVersionUID = -4829935907047172542L;

    @TableId
    private Long id;

    @ColumnWidth(18)
    @ExcelProperty(value = "名称")
    private String name;

    @ExcelProperty(value = "密钥")
    private String secret;

    @ExcelProperty(value = "备注")
    private String remark;

    @ExcelProperty(value = "排序")
    private Integer sort;

    @ExcelProperty(value = "状态")
    private Boolean status;

    @ExcelProperty(value = "上线次数统计")
    private Integer onlineCount;

    @ExcelProperty(value = "上线次数统计有效期")
    private LocalDateTime onlineCountExpire;

    @ApiModelProperty("上线标识(客户端分配)")
    private String onlineId;

    @ExcelProperty(value = "主页路径")
    @ApiModelProperty("主页路径")
    private String homeUrl;

    @ExcelProperty(value = "退出登录通知接口")
    @ApiModelProperty("退出登录通知接口")
    private String logoutNotifyUrl;

    @Version
    @ApiModelProperty(value = "乐观锁")
    protected Integer version;

    @JsonIgnore
    @Override
    public Serializable primaryKey() {
        return this.id;
    }

}
